<extend name="Public:base"/>

<block name="main">

<div id="yzh-content" class="col-xs-12">
    <div class="main-title">
        <h2>留言列表</h2>
    </div>


        <div class="table-actions">
            <a class="btn btn-sm btn-primary" onclick="myform.action='{:U('Feedback/deleteall')}';return confirm_deleteall()">删除</a>
            <a class="btn btn-sm btn-primary" onclick="myform.action='{:U('Feedback/listorder')}';$('#myform').submit();">排序</a>
            <a class="btn btn-sm btn-primary" onclick="myform.action='{:U('Feedback/statusallok')}';$('#myform').submit();" >通过审核</a>

            <div class="pull-right">
                <form action="{:U('Feedback/index')}" method="get" class="form-inline" role="form" >
                    <input type="hidden" name="g" value="{$Think.GROUP_NAME}" />
                    <input type="hidden" name="m" value="{$Think.MODULE_NAME}" />
                    <input type="hidden" name="a" value="{$Think.ACTION_NAME}" />
                    <div class="form-group">
                        <input id="title" type="text" class="form-control input-sm" name="keyword" value="{$Think.get.keyword}" />
                    </div>

                    <div class="form-group">
                        <select class="form-control input-sm" id="status" name="map[status]">
                            <option value="">{:L('status')}</option>
                            <option value="0" <if condition="isset($status) && $status ==0">selected="selected"</if>>未查看</option>
                            <option value="1" <if condition="isset($status) && $status ==1">selected="selected"</if>>已查看</option>
                        </select>
                    </div>

                    <div class="form-group">
                        <select class="form-control input-sm" name="listRows">
                            <option value="15" <if condition="$listRows ==5">selected="selected"</if>>15{:L('listRows')}</option>
                            <option value="20" <if condition="$listRows ==20">selected="selected"</if>>20{:L('listRows')}</option>
                            <option value="50" <if condition="$listRows ==50">selected="selected"</if>>50{:L('listRows')}</option>
                            <option value="100" <if condition="$listRows ==100">selected="selected"</if>>100{:L('listRows')}</option>
                        </select>
                    </div>
                    <input type="hidden" id="menuid" name="menuid" value="{$_GET['menuid']}"/>
                    <input type="submit" value="搜索"  class="btn btn-sm btn-primary" />
                </form>
            </div>

        </div>


    <form name="myform" id="myform" action="" method="post">

        <table class="table table-hover table-bordered table-condensed">
            <thead>
                    <tr>
                        <th width="30"><input type="checkbox" value="" id="check_box" onclick="selectall('ids[]');"></th>
                        <th width="40">{:L('listorder')}</th>
                        <th width="40">ID</th>
                        <th>姓名</th>
                        <th>主题</th>
                        <th>电话</th>
                        <th>邮箱</th>
                        <th width="60">{:L('status')}</th>
                        <th width="100">{:L('manage')}</th>
                        </tr>
                </thead>
                <tbody>
                    <volist name="list" id="vo" key="k">
                    <tr>
                    <td  width="30" align="center">
                    <input class="inputcheckbox " name="ids[]" value="{$vo['id']}" type="checkbox" ></td>
                    <td width="40" align='center'><input name='listorders[{$vo.id}]' type='text' size='3' value='{$vo.listorder}' class='input-text-c'></td>
                    <td align="center">{$vo['id']}</td>
                    <td>{$vo['uname']} </td>
                    <td>{$vo['title']} </td>
                    <td>{$vo['tel']} </td>
                    <td>{$vo['email']} </td>

                    <td align="center">
                    {if $vo['status']==1}
                    <font color="green">已查看</font>{else}<a href="{:U($module_name.'/status',array(id=>$vo['id'],status=>1))}"><font color="red">未查看</font></a>
                    {/if}
                    </td>

                    <td align="center">
                    <a href="{:U($module_name.'/edit',array(id=>$vo['id']))}">查看</a> |
                    <a href="javascript:confirm_delete('{:U($module_name.'/delete',array(id=>$vo['id']))}')">{:L('delete')}</a>
                    </td>
                    </tr>
                    </volist>
                </tbody>
        </table>

    </form>

    <div id="pages">{$page}</div>

</div>

<script>
$("#catid").attr("value",'{$catid}');
function confirm_deleteall(){
    art.dialog.confirm("{:L('real_delete')}", function(){ $('#myform').submit();});
}
</script>

</block>